summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2016-01-15 02:10:59 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-15 02:10:59 +0000
commitf1b398775c0f19d4b959df28614c8362c620b030 (patch)
tree89ae236531733283d84bde3c5638a0032ce9d03d
parent94121727f3baceee4e7f5f47bc27a87adb977d43 (diff)
parentba604d336b40fd4bde1622f64d67135bdbd61301 (diff)
downloadlibmpeg2-f1b398775c0f19d4b959df28614c8362c620b030.tar.gz
Fix for handling streams which resulted in negative num_mbs_left
am: ba604d336b * commit 'ba604d336b40fd4bde1622f64d67135bdbd61301': Fix for handling streams which resulted in negative num_mbs_left
-rw-r--r--decoder/impeg2d_dec_hdr.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/decoder/impeg2d_dec_hdr.c b/decoder/impeg2d_dec_hdr.c
index 0abd528..9e4a9a0 100644
--- a/decoder/impeg2d_dec_hdr.c
+++ b/decoder/impeg2d_dec_hdr.c
@@ -18,6 +18,7 @@
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
#include <string.h>
+#include <cutils/log.h>
#include "iv_datatypedef.h"
#include "iv.h"
@@ -929,6 +930,12 @@ void impeg2d_dec_pic_data_thread(dec_state_t *ps_dec)
temp = u4_bits_read & 0xFF;
i4_continue_decode = (((u4_bits_read >> 8) == 0x01) && (temp) && (temp <= 0xAF));
+ if (1 == ps_dec->i4_num_cores && 0 == ps_dec->u2_num_mbs_left)
+ {
+ i4_continue_decode = 0;
+ android_errorWriteLog(0x534e4554, "26070014");
+ }
+
if(i4_continue_decode)
{
/* If the slice is from the same row, then continue decoding without dequeue */
@@ -1191,7 +1198,7 @@ WORD32 impeg2d_get_slice_pos(dec_state_multi_core_t *ps_dec_state_multi_core)
i4_row -= 1;
- if(i4_prev_row != i4_row)
+ if(i4_prev_row < i4_row)
{
/* Create a job for previous slice row */
if(i4_start_row != -1)
@@ -1215,6 +1222,8 @@ WORD32 impeg2d_get_slice_pos(dec_state_multi_core_t *ps_dec_state_multi_core)
/* Store current slice's row position */
i4_start_row = i4_row;
+ } else if (i4_prev_row > i4_row) {
+ android_errorWriteLog(0x534e4554, "26070014");
}