]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cavsdec.c
h264: move list_count and current_slice reset to flush_change()
[ffmpeg] / libavcodec / cavsdec.c
index 34eeabdae21180f44e381ab95e4b6bdd38556819..cdcdccbd9c21d1869feb3a1361f68d3fb2802cca 100644 (file)
@@ -925,6 +925,7 @@ static inline int check_for_slice(AVSContext *h) {
 static int decode_pic(AVSContext *h) {
     MpegEncContext *s = &h->s;
     int skip_count = -1;
+    int ret;
     enum cavs_mb mb_type;
 
     if (!s->context_initialized) {
@@ -963,8 +964,10 @@ static int decode_pic(AVSContext *h) {
     if(h->picture.f.data[0])
         s->avctx->release_buffer(s->avctx, &h->picture.f);
 
-    ff_get_buffer(s->avctx, &h->picture.f);
-    ff_cavs_init_pic(h);
+    if ((ret = ff_get_buffer(s->avctx, &h->picture.f)) < 0)
+        return ret;
+    if ((ret = ff_cavs_init_pic(h)) < 0)
+        return ret;
     h->picture.poc = get_bits(&s->gb,8)*2;
 
     /* get temporal distances and MV scaling factors */