diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index c58bc31f6253615d5882ec72769e8c44b7d23f2b..ddbda1de4cc3d50b2d58dc27496cfcb7080e0ed8 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -178,7 +178,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
         av_log(avctx, AV_LOG_ERROR,
                "Error! Input buffer is too small [%d<%d]\n",
                buf_size, avctx->block_align);
-        return 0;
+        return AVERROR_INVALIDDATA;
     }
 
     out_size = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME *