Browse code

Check for invalid decode op-codes, fixes issue 2522.

Patch by Daniel Kang, daniel.d.kang at gmail

Originally committed as revision 26295 to svn://svn.ffmpeg.org/ffmpeg/trunk

Daniel Kang authored on 2011/01/10 19:47:10
Showing 1 changed files
... ...
@@ -99,6 +99,10 @@ static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y)
99 99
             motion_offset, s->upper_motion_limit_offset);
100 100
         return -1;
101 101
     }
102
+    if (src->data[0] == NULL) {
103
+        av_log(s->avctx, AV_LOG_ERROR, "Invalid decode type, corrupted header?\n");
104
+        return AVERROR(EINVAL);
105
+    }
102 106
     s->dsp.put_pixels_tab[!s->is_16bpp][0](s->pixel_ptr, src->data[0] + motion_offset,
103 107
                                            s->current_frame.linesize[0], 8);
104 108
     return 0;