vc1, mss2: Check for any negative return value from ff_vc1_parse_frame_header
authorMartin Storsjö <martin@martin.st>
Wed, 15 May 2013 08:51:03 +0000 (11:51 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 15 May 2013 09:13:53 +0000 (12:13 +0300)
This is required if we return other error codes than explicitly
-1, which so far has been the only other possible return value
besides 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/mss2.c
libavcodec/vc1dec.c

index 44b6f1f..2562209 100644 (file)
@@ -388,7 +388,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
 
     s->loop_filter = avctx->skip_loop_filter < AVDISCARD_ALL;
 
-    if (ff_vc1_parse_frame_header(v, &s->gb) == -1) {
+    if (ff_vc1_parse_frame_header(v, &s->gb) < 0) {
         av_log(v->s.avctx, AV_LOG_ERROR, "header error\n");
         return AVERROR_INVALIDDATA;
     }
index a3b6031..86806b1 100644 (file)
@@ -5464,11 +5464,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
     // do parse frame header
     v->pic_header_flag = 0;
     if (v->profile < PROFILE_ADVANCED) {
-        if (ff_vc1_parse_frame_header(v, &s->gb) == -1) {
+        if (ff_vc1_parse_frame_header(v, &s->gb) < 0) {
             goto err;
         }
     } else {
-        if (ff_vc1_parse_frame_header_adv(v, &s->gb) == -1) {
+        if (ff_vc1_parse_frame_header_adv(v, &s->gb) < 0) {
             goto err;
         }
     }