[FFmpeg-devel] [PATCH] Fix decoding of ffv1 when compiling with icc

Carl Eugen Hoyos cehoyos
Sat May 24 00:14:59 CEST 2008


I don't know what the C standard says about this, but icc compiles ffv1.c 
differently than gcc: Only sample[0] / sample[0][0] are initialized 

Attached patch allows icc compilations to pass make test.

In case this is not acceptable: Could anybody point me to the relevant 
part of the C specification and/or provide a minmal testcase so I can 
report the bug to Intel?

Thank you, Carl Eugen
-------------- next part --------------
Index: libavcodec/ffv1.c
--- libavcodec/ffv1.c	(revision 13263)
+++ libavcodec/ffv1.c	(working copy)
@@ -768,7 +768,9 @@
 static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
     int x, y;
     int_fast16_t sample_buffer[2][w+6];
-    int_fast16_t *sample[2]= {sample_buffer[0]+3, sample_buffer[1]+3};
+    int_fast16_t *sample[2];
+    sample[0]=sample_buffer[0]+3;
+    sample[1]=sample_buffer[1]+3;
@@ -795,10 +797,13 @@
 static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
     int x, y, p;
     int_fast16_t sample_buffer[3][2][w+6];
-    int_fast16_t *sample[3][2]= {
-        {sample_buffer[0][0]+3, sample_buffer[0][1]+3},
-        {sample_buffer[1][0]+3, sample_buffer[1][1]+3},
-        {sample_buffer[2][0]+3, sample_buffer[2][1]+3}};
+    int_fast16_t *sample[3][2];
+    sample[0][0] = sample_buffer[0][0]+3;
+    sample[0][1] = sample_buffer[0][1]+3;
+    sample[1][0] = sample_buffer[1][0]+3;
+    sample[1][1] = sample_buffer[1][1]+3;
+    sample[2][0] = sample_buffer[2][0]+3;
+    sample[2][1] = sample_buffer[2][1]+3;

More information about the ffmpeg-devel mailing list