Lujango / gifview

Automatically exported from code.google.com/p/gifview
0 stars 0 forks source link

GifDecoder类有一部分代码存在问题,造成空引用的异常。 #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
GifDecoder类有一部分代码存在问题,造成空引用的异常。
int save = 0;
if (transparency) {
   save = act[transIndex];
   act[transIndex] = 0; // set transparent color if specified
}
if (act == null) {
   status = STATUS_FORMAT_ERROR; // no color table defined
}

act 是不是应该先判断是否为null?
if (transparency) {
   if(acr != null){
   save = act[transIndex];
   act[transIndex] = 0; // set transparent color if specified
}
}

Original issue reported on code.google.com by luoj...@gmail.com on 16 Nov 2011 at 6:44

GoogleCodeExporter commented 8 years ago
if (transparency) {
   if(act != null && act.length > 0 && act.length > transIndex){
   save = act[transIndex];
   act[transIndex] = 0; // set transparent color if specified
}
}

Original comment by luoj...@gmail.com on 16 Nov 2011 at 6:49