Browse code

avcodec/4xm: Fix returned error codes

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 07607a1db879d0d96e2c91e1354bc4e425937d3a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2019/01/01 02:11:44
Showing 1 changed files
... ...
@@ -498,7 +498,7 @@ static int decode_i_block(FourXContext *f, int16_t *block)
498 498
 
499 499
     if (get_bits_left(&f->gb) < 2){
500 500
         av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb));
501
-        return -1;
501
+        return AVERROR_INVALIDDATA;
502 502
     }
503 503
 
504 504
     /* DC coef */
... ...
@@ -732,7 +732,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
732 732
         for (x = 0; x < width; x += 16) {
733 733
             unsigned int color[4] = { 0 }, bits;
734 734
             if (buf_end - buf < 8)
735
-                return -1;
735
+                return AVERROR_INVALIDDATA;
736 736
             // warning following is purely guessed ...
737 737
             color[0] = bytestream2_get_le16u(&g3);
738 738
             color[1] = bytestream2_get_le16u(&g3);