]> granicus.if.org Git - libvpx/commitdiff
Use -1 consistently as invalid buffer idx
authorYaowu Xu <yaowu@google.com>
Tue, 6 Jan 2015 21:50:18 +0000 (13:50 -0800)
committerYaowu Xu <yaowu@google.com>
Tue, 6 Jan 2015 23:59:03 +0000 (15:59 -0800)
Instead of mixed use of both -1 and INT_MAX.

This also fixes a vp9 fuzzing test failure.

Change-Id: I950ea94b44ec7cdb5232773bee30b104e342f52a

vp9/decoder/vp9_decoder.c

index 1406b4034020536446722e5c64c4d6bc3bc91b06..80654b19cbbbe3d7bc19902884beff7b12a43bb1 100644 (file)
@@ -238,7 +238,7 @@ static void swap_frame_buffers(VP9Decoder *pbi) {
 
   // Invalidate these references until the next frame starts.
   for (ref_index = 0; ref_index < 3; ref_index++)
-    cm->frame_refs[ref_index].idx = INT_MAX;
+    cm->frame_refs[ref_index].idx = -1;
 }
 
 int vp9_receive_compressed_data(VP9Decoder *pbi,
@@ -258,7 +258,7 @@ int vp9_receive_compressed_data(VP9Decoder *pbi,
     // TODO(jkoleszar): Error concealment is undefined and non-normative
     // at this point, but if it becomes so, [0] may not always be the correct
     // thing to do here.
-    if (cm->frame_refs[0].idx != INT_MAX)
+    if (cm->frame_refs[0].idx > 0)
       cm->frame_refs[0].buf->corrupted = 1;
   }